package com.ambulance.project.manager.domain;

import com.ambulance.framework.aspectj.lang.annotation.Excel;
import com.ambulance.framework.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 调度记录基本信息对象 biz_dispatch
 *
 * @author zr
 * @date 2020-05-11
 */
public class BizDispatch extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 调度标识
     */
    private Long dispatchID;

    /**
     * 车辆ID
     */
    @Excel(name = "车辆ID")
    private Long carID;

    /**
     * 0未结束，1已结束
     */
    @Excel(name = "0未结束，1已结束")
    private Integer isOver;

    /**
     * 班组ID
     */
    @Excel(name = "班组ID")
    private Long classID;

    /**
     * 医生ID
     */
    @Excel(name = "医生ID")
    private Long doctorID;

    /**
     * 护士ID
     */
    @Excel(name = "护士ID")
    private Long nurseID;

    /**
     * 病人ID
     */
    @Excel(name = "病人ID")
    private Long patientID;

    /**
     * 司机ID
     */
    @Excel(name = "司机ID")
    private Long driverID;

    /**
     * 收治医院名称
     */
    @Excel(name = "收治医院名称")
    private String hospital;

    /**
     * 接警时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "接警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date receiveHelpTime;

    /**
     * 调度时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "调度时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date dispatchTime;

    /**
     * 出车时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "出车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date leaveHospTime;

    /**
     * 到达时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "到达时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date arriveDestTime;

    /**
     * 离开时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "离开时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date leaveDestTime;

    /**
     * 到达患者备注
     */
    @Excel(name = "到达患者备注")
    private String arriveDestContent;

    /**
     * 到达医院时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "到达医院时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date arriveHostTime;

    /**
     * 到达医院备注
     */
    @Excel(name = "到达医院备注")
    private String arriveHosp;

    /**
     * 会诊开始
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "会诊开始", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date treatStart;

    /**
     * 会诊结合
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "会诊结合", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date treatEnd;

    /**
     * 会诊内容
     */
    @Excel(name = "会诊内容")
    private String treatContent;

    /**
     * 通话指导开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "通话指导开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date guideStart;

    /**
     * 指导结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "指导结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date guideEnd;

    /**
     * 通话时长s
     */
    @Excel(name = "通话时长s")
    private Long phoneGuideUseTime;

    /**
     * 指导内容
     */
    @Excel(name = "指导内容")
    private String guideContent;

    /**
     * 用药开始
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "用药开始", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date medicineStart;

    /**
     * 用药结束
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "用药结束", width = 30, dateFormat = "yyyy-MM-dd ", type = Excel.Type.EXPORT)
    private Date medicineEnd;

    /**
     * 调度状态0接警，1出车，2通话指导，3到达现场，4上车转运，5发起会诊，6溶栓开始7溶栓结束，8到达医院
     */
    @Excel(name = "调度状态0接警，1出车，2通话指导，3到达现场，4上车转运，5发起会诊，6溶栓开始7溶栓结束，8到达医院")
    private Integer status;

    /**
     * 是否会诊 (0=否 1=是)
     */
    @Excel(name = "是否会诊 (0=否 1=是)")
    private Integer isConsultation;

    /**
     * 车牌号
     */
    @Excel(name = "车牌号")
    private String vin;

    /**
     * 车辆类型 0普通救护车/1卒中救护车
     */
    @Excel(name = "车辆类型 0普通救护车/1卒中救护车")
    private Long carType;

    /**
     * 医生姓名
     */
    @Excel(name = "医生姓名")
    private String doctorName;

    /**
     * 患者姓名
     */
    @Excel(name = "患者姓名")
    private String patientName;

    private String patientLocal;

    private Integer dispatchCaseID;

    /**
     * 设备id
     */
    private String carDeviceID;

    private String hsVideoUrl;

    public String getHsVideoUrl() {
        return hsVideoUrl;
    }

    public void setHsVideoUrl(String hsVideoUrl) {
        this.hsVideoUrl = hsVideoUrl;
    }

    public String getCarDeviceID() {
        return carDeviceID;
    }

    public void setCarDeviceID(String carDeviceID) {
        this.carDeviceID = carDeviceID;
    }

    public Integer getDispatchCaseID() {
        return dispatchCaseID;
    }

    public void setDispatchCaseID(Integer dispatchCaseID) {
        this.dispatchCaseID = dispatchCaseID;
    }

    public String getPatientLocal() {
        return patientLocal;
    }

    public void setPatientLocal(String patientLocal) {
        this.patientLocal = patientLocal;
    }

    @Excel(name = "护士姓名")
    private String nurseName;

    /**
     * 患者身份证信息
     */
    @Excel(name = "患者身份证信息")
    private String patientCard;

    /**
     * 司机电话
     */
    @Excel(name = "司机电话")
    private String driverPhone;

    /**
     * 医生电话
     */
    @Excel(name = "医生电话")
    private String doctorPhone;

    /**
     * 司机姓名
     */
    @Excel(name = "司机姓名")
    private String driverName;

    /**
     * 来电类型
     */
    @Excel(name = "来电类型")
    private Integer phoneType;

    /**
     * 医院标识
     */
    @Excel(name = "医院标识")
    private Long uid;


    private String  cancelReason;

    /**
     * 汇声推流地址
     */
    private String hsRtmp;

    /**
     * 查询出车时间
     */
    private String leaveHospTime1;
    private String leaveHospTime2;
    public String getHsRtmp() {
        return hsRtmp;
    }

    public String getLeaveHospTime1() {
        return leaveHospTime1;
    }

    public void setLeaveHospTime1(String leaveHospTime1) {
        this.leaveHospTime1 = leaveHospTime1;
    }

    public String getLeaveHospTime2() {
        return leaveHospTime2;
    }

    public void setLeaveHospTime2(String leaveHospTime2) {
        this.leaveHospTime2 = leaveHospTime2;
    }

    public void setHsRtmp(String hsRtmp) {
        this.hsRtmp = hsRtmp;
    }

    public Integer getHsStatus() {
        return hsStatus;
    }

    public void setHsStatus(Integer hsStatus) {
        this.hsStatus = hsStatus;
    }

    /**
     * 汇声推流状态 1=未推流,2=推流中
     */
    private Integer hsStatus;
    /**
     * 调度流水
     */
    @Excel(name = "调度流水")
    private String flow;

    private BizPatient bizPatient;

    private BizDoctor bizDoctor;

    private  BizNurse bizNurse;

    private BizDriver bizDriver;

    private BizClass bizClass;

    private BizCar bizCar;

    public BizCar getBizCar() {
        return bizCar;
    }

    public void setBizCar(BizCar bizCar) {
        this.bizCar = bizCar;
    }

    public BizPatient getBizPatient() {
        return bizPatient;
    }

    public void setBizPatient(BizPatient bizPatient) {
        this.bizPatient = bizPatient;
    }

    public BizDoctor getBizDoctor() {
        return bizDoctor;
    }

    public void setBizDoctor(BizDoctor bizDoctor) {
        this.bizDoctor = bizDoctor;
    }

    public BizNurse getBizNurse() {
        return bizNurse;
    }

    public void setBizNurse(BizNurse bizNurse) {
        this.bizNurse = bizNurse;
    }

    public BizDriver getBizDriver() {
        return bizDriver;
    }

    public void setBizDriver(BizDriver bizDriver) {
        this.bizDriver = bizDriver;
    }

    public BizClass getBizClass() {
        return bizClass;
    }

    public void setBizClass(BizClass bizClass) {
        this.bizClass = bizClass;
    }

    /**
     * 取消派车时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "取消派车时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date cancelTime;

    private String caseFlow;

    public String getCancelReason() {
        return cancelReason;
    }

    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }

    public String getCaseFlow() {
        String substring = "";
        if(null==getFlow()){
            return substring;
        }
        if (!getFlow().isEmpty()) {
            substring = flow.substring(0, flow.length() - 4);
        }
        return substring;
    }

    public void setCaseFlow(String caseFlow) {
        this.caseFlow = caseFlow;
    }

    public String getNurseName() {
        return nurseName;
    }

    public void setNurseName(String nurseName) {
        this.nurseName = nurseName;
    }

    public Long getDispatchID() {
        return dispatchID;
    }

    public void setDispatchID(Long dispatchID) {
        this.dispatchID = dispatchID;
    }

    public Long getCarID() {
        return carID;
    }

    public void setCarID(Long carID) {
        this.carID = carID;
    }

    public Integer getIsOver() {
        return isOver;
    }

    public void setIsOver(Integer isOver) {
        this.isOver = isOver;
    }

    public Long getClassID() {
        return classID;
    }

    public void setClassID(Long classID) {
        this.classID = classID;
    }

    public Long getDoctorID() {
        return doctorID;
    }

    public void setDoctorID(Long doctorID) {
        this.doctorID = doctorID;
    }

    public Long getNurseID() {
        return nurseID;
    }

    public void setNurseID(Long nurseID) {
        this.nurseID = nurseID;
    }

    public Long getPatientID() {
        return patientID;
    }

    public void setPatientID(Long patientID) {
        this.patientID = patientID;
    }

    public Long getDriverID() {
        return driverID;
    }

    public void setDriverID(Long driverID) {
        this.driverID = driverID;
    }

    public String getHospital() {
        return hospital;
    }

    public void setHospital(String hospital) {
        this.hospital = hospital;
    }

    public Date getReceiveHelpTime() {
        return receiveHelpTime;
    }

    public void setReceiveHelpTime(Date receiveHelpTime) {
        this.receiveHelpTime = receiveHelpTime;
    }

    public Date getDispatchTime() {
        return dispatchTime;
    }

    public void setDispatchTime(Date dispatchTime) {
        this.dispatchTime = dispatchTime;
    }

    public Date getLeaveHospTime() {
        return leaveHospTime;
    }

    public void setLeaveHospTime(Date leaveHospTime) {
        this.leaveHospTime = leaveHospTime;
    }

    public Date getArriveDestTime() {
        return arriveDestTime;
    }

    public void setArriveDestTime(Date arriveDestTime) {
        this.arriveDestTime = arriveDestTime;
    }

    public Date getLeaveDestTime() {
        return leaveDestTime;
    }

    public void setLeaveDestTime(Date leaveDestTime) {
        this.leaveDestTime = leaveDestTime;
    }

    public String getArriveDestContent() {
        return arriveDestContent;
    }

    public void setArriveDestContent(String arriveDestContent) {
        this.arriveDestContent = arriveDestContent;
    }

    public Date getArriveHostTime() {
        return arriveHostTime;
    }

    public void setArriveHostTime(Date arriveHostTime) {
        this.arriveHostTime = arriveHostTime;
    }

    public String getArriveHosp() {
        return arriveHosp;
    }

    public void setArriveHosp(String arriveHosp) {
        this.arriveHosp = arriveHosp;
    }

    public Date getTreatStart() {
        return treatStart;
    }

    public void setTreatStart(Date treatStart) {
        this.treatStart = treatStart;
    }

    public Date getTreatEnd() {
        return treatEnd;
    }

    public void setTreatEnd(Date treatEnd) {
        this.treatEnd = treatEnd;
    }

    public String getTreatContent() {
        return treatContent;
    }

    public void setTreatContent(String treatContent) {
        this.treatContent = treatContent;
    }

    public Date getGuideStart() {
        return guideStart;
    }

    public void setGuideStart(Date guideStart) {
        this.guideStart = guideStart;
    }

    public Date getGuideEnd() {
        return guideEnd;
    }

    public void setGuideEnd(Date guideEnd) {
        this.guideEnd = guideEnd;
    }

    public Long getPhoneGuideUseTime() {
        return phoneGuideUseTime;
    }

    public void setPhoneGuideUseTime(Long phoneGuideUseTime) {
        this.phoneGuideUseTime = phoneGuideUseTime;
    }

    public String getGuideContent() {
        return guideContent;
    }

    public void setGuideContent(String guideContent) {
        this.guideContent = guideContent;
    }

    public Date getMedicineStart() {
        return medicineStart;
    }

    public void setMedicineStart(Date medicineStart) {
        this.medicineStart = medicineStart;
    }

    public Date getMedicineEnd() {
        return medicineEnd;
    }

    public void setMedicineEnd(Date medicineEnd) {
        this.medicineEnd = medicineEnd;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsConsultation() {
        return isConsultation;
    }

    public void setIsConsultation(Integer isConsultation) {
        this.isConsultation = isConsultation;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public Long getCarType() {
        return carType;
    }

    public void setCarType(Long carType) {
        this.carType = carType;
    }

    public String getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    public String getPatientCard() {
        return patientCard;
    }

    public void setPatientCard(String patientCard) {
        this.patientCard = patientCard;
    }

    public String getDriverPhone() {
        return driverPhone;
    }

    public void setDriverPhone(String driverPhone) {
        this.driverPhone = driverPhone;
    }

    public String getDoctorPhone() {
        return doctorPhone;
    }

    public void setDoctorPhone(String doctorPhone) {
        this.doctorPhone = doctorPhone;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public Integer getPhoneType() {
        return phoneType;
    }

    public void setPhoneType(Integer phoneType) {
        this.phoneType = phoneType;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public String getFlow() {
        return flow;
    }

    public void setFlow(String flow) {
        this.flow = flow;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("dispatchID", getDispatchID())
                .append("carID", getCarID())
                .append("isOver", getIsOver())
                .append("classID", getClassID())
                .append("doctorID", getDoctorID())
                .append("nurseID", getNurseID())
                .append("patientID", getPatientID())
                .append("driverID", getDriverID())
                .append("hospital", getHospital())
                .append("receiveHelpTime", getReceiveHelpTime())
                .append("dispatchTime", getDispatchTime())
                .append("leaveHospTime", getLeaveHospTime())
                .append("arriveDestTime", getArriveDestTime())
                .append("leaveDestTime", getLeaveDestTime())
                .append("arriveDestContent", getArriveDestContent())
                .append("arriveHostTime", getArriveHostTime())
                .append("arriveHosp", getArriveHosp())
                .append("treatStart", getTreatStart())
                .append("treatEnd", getTreatEnd())
                .append("treatContent", getTreatContent())
                .append("guideStart", getGuideStart())
                .append("guideEnd", getGuideEnd())
                .append("phoneGuideUseTime", getPhoneGuideUseTime())
                .append("guideContent", getGuideContent())
                .append("medicineStart", getMedicineStart())
                .append("medicineEnd", getMedicineEnd())
                .append("status", getStatus())
                .append("isConsultation", getIsConsultation())
                .append("vin", getVin())
                .append("carType", getCarType())
                .append("doctorName", getDoctorName())
                .append("patientName", getPatientName())
                .append("patientCard", getPatientCard())
                .append("driverPhone", getDriverPhone())
                .append("doctorPhone", getDoctorPhone())
                .append("driverName", getDriverName())
                .append("phoneType", getPhoneType())
                .append("uid", getUid())
                .append("flow", getFlow())
                .append("cancelTime", getCancelTime())
                .toString();
    }
}
